package com.huan.iteye.analysis.repository;

import com.huan.iteye.analysis.domain.IteyeBlogTotalViews;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 每天博客总的访问量 repository
 *
 * @author huan.fu
 * @date 2018/9/14 - 16:40
 */
public interface IteyeBlogTotalViewsRepository extends JpaRepository<IteyeBlogTotalViews, Long> {

	/**
	 * 获取一段时间内的博客访问总量
	 *
	 * @param workDays
	 * @return
	 */
	List<IteyeBlogTotalViews> findByWorkDateIn(List<String> workDays);

	/**
	 * 删除 业务日期不在下方参数中的博客访问数据
	 *
	 * @param workDays
	 */
	@Transactional(rollbackFor = Exception.class)
	void deleteByWorkDateNotIn(List<String> workDays);
}
